<!-- 图标列表 -->
<template>
<div class="icon-list-wp clearfix">
  <div v-for="(item, index) in list" :key="index" class="item"
    :class="{active: item == value}"
    :title="item"
    @click="$emit('update:value', item)">
    <i :class="item"></i>
  </div>
</div>
</template>
<script>
export default {
  props: {
    // 当前选中的icon
    value: {
      default: ''
    },
    list: {
      default () {
        return []
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.icon-list-wp {
  padding: 15px 0 0 15px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  .item {
    float: left;
    margin: 0 15px 15px 0;
    width: 32px;
    height: 32px;
    border: 1px solid #F1F1F1;
    box-sizing: border-box;
    line-height: 30px;
    text-align: center;
    font-size: 22px;
    color: #4A4A48;
    cursor: pointer;
    &:hover, &.active {
      background: #4A4A48;
      color: #fff;
    }
  }
}
</style>